<div class="widget">
    <div class="widgetTitle">
        <h3><?= $title; ?></h3>
    </div>

    <div class="widgetContent bottom-border">
        <div class="row nomargin">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <p class="block text-muted clearfix">
                    Please provide correct information of your Business and Services, we have full right to delete your
                    post anytime without prior intimation.
                </p>

                <?php if(Session::get('message')){?>
                <p class="block">
                    <span class="text-danger"><?= Session::get('message');?></span>
                </p>
                <?php }?>

                <style>

                    .parent {
                        width: 90%;
                        float: left;
                        margin-bottom: 12px; clear: all;
                    }

                    .multiple {
                        max-height: 200px; overflow: auto; width: 100%; border: 1px solid #ddd;
                        list-style-type: none; margin: 0; padding: 10px; overflow-x: hidden;
                        font-weight: 300;
                    }


                </style>

                <form class="form-horizontal" method="post" action="<?= URL::current();?>" accept-charset="<?= Settings::get('en','charecter_set')?>">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Title <span class="red"> * </span></label>

                        <div class="col-sm-8">
                            <input type="text" name="title" id="title" class="field" placeholder="Business Title" value="<?= $post->title;?>" >
                        </div>
                    </div>



                    <div class="form-group">
                        <label class="col-sm-2 control-label">Category <span class="red"> * </span></label>



                        <div class="col-sm-8">
                            <div id="show_sub_categories">
                                <input type="hidden" name="category" value="<?= $category->id;?>">
                                <select name="search_category" class="parent field">
                                    <option value="<?= $category->value;?>" selected="selected" class="text-danger"><?= $category->name;?></option>

                                    <?php foreach ($cat_parent as $pCat): ?>
                                        <option value="<?= $pCat->id; ?>"><?= $pCat->name; ?></option>
                                    <?php endforeach; ?>
                                </select>
                            </div>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-2 control-label">&nbsp;</label>
                        <div class="col-sm-8">
                            <label class="control-label"><strong>Category</strong> </label>
                            <ul class="list-inline">
                                <?php foreach($pre_cats as $pre_cat):?>
                                    <li><?= Categories::find($pre_cat->value)->name;?></li> &rarr;
                                <?php endforeach;?>
                            </ul>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">&nbsp;</label>
                        <div class="col-sm-8">
                            <?php if($keywords){?>
                                <label class="control-label"><strong>Keywords</strong> </label>
                                <div id="saved_keyword">
                                    <ul class="list-inline thin text-success">
                                        <?php foreach($keywords as $key):?>
                                            <li class="col-sm-6"><?= Categories::find($key->value)->name;?> &nbsp; <a href="#" attr = "<?= $key->value;?>" class="text-red">X</a></li>
                                        <?php endforeach;?>
                                    </ul>
                                </div>
                            <?php } ?>
                        </div>
                    </div>

                    <hr>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">Street <span class="red"> * </span> </label>

                        <div class="col-sm-8">
                            <input type="text" class="field" id="street" name="street" placeholder="Street" value="<?= $post->address1;?>" >
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">Address(2)</label>
                        <div class="col-sm-8">
                            <input type="text" class="field" name="address2" id="address2" placeholder="Address line 2" value="<?= $post->address2;?>" >
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">Zip Code</label>
                        <div class="col-sm-3">
                            <input type="text" class="field" name="zip" id="zip" placeholder="Zip Code" value="<?= $post->zip_code;?>" >
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">Location <span class="red"> * </span></label>
                        <div class="col-sm-6">
                            <input type="hidden" name="location" value="<?=$location->id;?>">
                            <input type="text" name="selectbox-mylocation" id="selectbox-mylocation"
                                   class="field select2" data-placeholder="<?= $location->name;?>"   />
                        </div>
                    </div>


                    <div class="form-group widget-footer">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-success">Update & Continue</button>
                        </div>

                    </div>
                </form>

            </div>
        </div>
    </div>
</div>